package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-07-27
 * Time: 9:15
 */
public class TestDemo {

    public static class MyThread extends Thread{
        @Override
        public void run() {
            while(true){
                System.out.println("我是Thread!!!");
                try {
                    sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) {
        Thread t = new MyThread();

        t.start();
        t.start();
        //t.run();
        while(true){
            System.out.println("我是main!!!");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }


}
